Telegram Group & Telegram Channel
Native Python float values use your computer hardware directly, so any value is represented internally as a binary fraction.

That means that you usually work with approximations, not exact values:

In : format(0.1, '.17f')
Out: '0.10000000000000001'


The decimal module lets you use decimal floating point arithmetic with arbitrary precision:

In : Decimal(1) / Decimal(3)
Out: Decimal('0.3333333333333333333333333333')


That's still can be not enough:

In [61]: Decimal(1) / Decimal(3) * Decimal(3) == Decimal(1)
Out[61]: False


For perfect computations, you can use fractions, that stores any number as a rational one:

In : Fraction(1) / Fraction(3) * Fraction(3) == Fraction(1)
Out: True


The obvious limitation is you still have to use approximations to irrational numbers (such as π).



tg-me.com/pythonetc/201
Create:
Last Update:

Native Python float values use your computer hardware directly, so any value is represented internally as a binary fraction.

That means that you usually work with approximations, not exact values:

In : format(0.1, '.17f')
Out: '0.10000000000000001'


The decimal module lets you use decimal floating point arithmetic with arbitrary precision:

In : Decimal(1) / Decimal(3)
Out: Decimal('0.3333333333333333333333333333')


That's still can be not enough:

In [61]: Decimal(1) / Decimal(3) * Decimal(3) == Decimal(1)
Out[61]: False


For perfect computations, you can use fractions, that stores any number as a rational one:

In : Fraction(1) / Fraction(3) * Fraction(3) == Fraction(1)
Out: True


The obvious limitation is you still have to use approximations to irrational numbers (such as π).

BY Python etc


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 280

Share with your friend now:
tg-me.com/pythonetc/201

View MORE
Open in Telegram


Python etc Telegram | DID YOU KNOW?

Date: |

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

Python etc from kr


Telegram Python etc
FROM USA